chrome.webRequest.onCompleted.addListener(function(details){
	console.log("Auto loop: " + details.url);
	chrome.tabs.executeScript(details.tabId,{
		"file": "content_script.js"
	});
},
{urls: ["http://loop.xiami.com/loop/getsong?id=*"]},
["responseHeaders"]);

chrome.tabs.onUpdated.addListener(function(tabId,changeInfo,tab){
	if(/^http:\/\/loop.xiami.com\/room\/\d{5}$/.test(tab.url)){
		console.log("Updated tab url is " + tab.url);
		chrome.pageAction.show(tab.id);
		console.log("show icon in " + tab.url);
	}
});

